using System;
using System.Collections.Generic;
using System.Diagnostics;
using wpffc.contracts.domaindata;
using wpffc.contracts.infrastructure;

namespace wpffc.flashcardbox
{
    public class Learn
    {
        public Learn(Advance_card adv, Refill_batch refill, Get_next_card next)
        {
            _process_answer += adv.Process;
            _start_learning += refill.Process;

            adv.Continue += refill.Process;

            refill.Result += next.Process;

            next.Result += _ => NextCardToLearn(_);
        }

        private Action<bool> _process_answer;
        public void Process_answer(bool knewTheAnswer)
        {
            _process_answer(knewTheAnswer);
        }

        private Action<IFlashCardBox> _start_learning;
        public void Start_learning(IFlashCardBox box)
        {
            _start_learning(box);
        }

        public event Action<Card> NextCardToLearn;
    }
}